Imports System.Xml.Serialization
Namespace SSDL

    Public Class EntityContainerEntitySet
        Inherits XEntityModelElementWithDocumentationBase

        ''' <summary>Initializes an instance of the <see cref="EntityContainerEntitySet" /> class.
        ''' This is the default constructor for this class.</summary>
        Public Sub New()
            MyBase.New("EntitySet", SsdlXmlNamespace)
        End Sub

        ''' <summary>Initializes an instance of the <see cref="EntityContainerEntitySet" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        Public Property DefiningQuery() As String
            Get
                Dim name = MyBase.Name.Namespace + "DefiningQuery"
                If (Me.Element(name) Is Nothing) Then
                    Return String.Empty
                End If
                Return Me.Element(name).Value
            End Get
            Set(ByVal value As String)
                Dim name = MyBase.Name.Namespace + "DefiningQuery"
                If (Me.Element(name) Is Nothing) Then
                    Me.Add(New XElement(name))
                End If
                Me.Element(name).Value = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Shadows Property Name() As String
            Get
                Return Me.@Name
            End Get
            Set(ByVal value As String)
                Me.@Name = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property EntityType() As String
            Get
                Return Me.@EntityType
            End Get
            Set(ByVal value As String)
                Me.@EntityType = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property Schema() As String
            Get
                Return Me.@Schema
            End Get
            Set(ByVal value As String)
                Me.@Schema = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property Table() As String
            Get
                Return Me.@Table
            End Get
            Set(ByVal value As String)
                Me.@Table = value
            End Set
        End Property

        <XmlAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Qualified, [Namespace]:=EntityStoreSchemaGeneratorXmlNamespace)> _
        Public Property Type() As SourceType
            Get
                Return GetEnumValueAttribute(GetType(SourceType), Me.Attribute(XName.Get("Type", MyBase.Name.NamespaceName)))
            End Get
            Set(ByVal value As SourceType)
                If (Me.Attribute(XName.Get("Type", MyBase.Name.NamespaceName)) Is Nothing) Then
                    Me.Add(New XAttribute(XName.Get("Type", MyBase.Name.NamespaceName), ""))
                End If
                SetEnumValueAttribute(GetType(SourceType), Me.Attribute(XName.Get("Type", MyBase.Name.NamespaceName)), value)
            End Set
        End Property

        <XmlAttribute("Schema", Form:=System.Xml.Schema.XmlSchemaForm.Qualified, [Namespace]:=EntityStoreSchemaGeneratorXmlNamespace)> _
        Public Property SchemaGenerator() As String
            Get
                Return Me.Attribute(XName.Get("Schema", EntityStoreSchemaGeneratorXmlNamespace))
            End Get
            Set(ByVal value As String)
                If (Me.Attribute(XName.Get("Schema", EntityStoreSchemaGeneratorXmlNamespace)) Is Nothing) Then
                    Me.Add(New XAttribute(XName.Get("Schema", EntityStoreSchemaGeneratorXmlNamespace), value))
                Else
                    Me.Attribute(XName.Get("Schema", EntityStoreSchemaGeneratorXmlNamespace)).Value = value
                End If
            End Set
        End Property

        <XmlAttribute("Name", Form:=System.Xml.Schema.XmlSchemaForm.Qualified, [Namespace]:=EntityStoreSchemaGeneratorXmlNamespace)> _
        Public Property NameSchemaGenerator() As String
            Get
                Return Me.Attribute(XName.Get("Name", EntityStoreSchemaGeneratorXmlNamespace))
            End Get
            Set(ByVal value As String)
                If (Me.Attribute(XName.Get("Name", EntityStoreSchemaGeneratorXmlNamespace)) Is Nothing) Then
                    Me.Add(New XAttribute(XName.Get("Name", EntityStoreSchemaGeneratorXmlNamespace), value))
                Else
                    Me.Attribute(XName.Get("Name", EntityStoreSchemaGeneratorXmlNamespace)).Value = value
                End If
            End Set
        End Property

    End Class

End Namespace